package a10_动态规划;

import java.util.Scanner;

/**
 * <p>
 * a22_爬楼梯进阶版复习3
 * </p>
 *
 * @author flyduck
 * @since 2025/3/25
 */
public class a22_爬楼梯进阶版复习3 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);

        int total = scanner.nextInt();
        int maxStep = scanner.nextInt();

        int[] dp = new int[total+1];
        dp[0] = 1;
        for (int j = 1; j <= total; j++) {
            for (int i = 1; i <= maxStep; i++) {
                if(j >= i){
                  dp[j] = dp[j] + dp[j- i];
                }
            }
        }

        System.out.println(dp[total]);

    }
}
